import Vue from 'vue'
import adapter from 'axios-miniprogram-adapter'
import axios from 'axios'
import {
	Promise
} from 'core-js';
axios.defaults.adapter = adapter;
const request = axios.create({
	baseURL: "http://shop-api.edu.koobietech.com",

})

request.interceptors.request.use((config) => {
		const token = uni.getStorageSync("token")
		if (token) {
			config.headers.Authorization = token;
		}
		return config;
	},
	error => {
		return Promise.reject(error);
	})

request.interceptors.response.use((response) => {
		return response
	},
	error => {
		return Promise.reject(error)
	}
)

export default request